<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <div id="app">
     <counter-com></counter-com>
  </div>
  <script src="./vue.js"></script>
  <script>
      Vue.component("counterCom",{
          data() {
              return {
                  msg:"我是一个全局组件"
              }
          },
          template:" <h1>{{msg}} <span>只能有一个根元素</span></h1>"
      })


    var vm = new Vue({
      el:'#app',
      data:{
      },
      methods:{
      }
     });
  </script>
</body>
</html>
